# Contributor: Bart Ribbers <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-other
maintainer="team/kde <bribbers@disroot.org>"
pkgname=kirigami-addons
pkgver=1.5.0
pkgrel=0
pkgdesc="Add-ons for the Kirigami framework"
url="https://invent.kde.org/libraries/kirigami-addons"
# armhf blocked by extra-cmake-modules
arch="all !armhf"
license="LGPL-2.0-or-later AND GPL-2.0-or-later"
depends="
	kirigami
	qt6-qtmultimedia
	"
makedepends="
	extra-cmake-modules
	kglobalaccel-dev
	kguiaddons-dev
	ki18n-dev
	kirigami-dev
	samurai
	"
checkdepends="xvfb-run"
subpackages="$pkgname-dev $pkgname-lang"
_repo_url="https://invent.kde.org/libraries/kirigami-addons.git"
source="https://download.kde.org/stable/kirigami-addons/kirigami-addons-$pkgver.tar.xz"
options="!check" # Too flaky to rely on currently

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=MinSizeRel \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_TESTING=ON \
		-DBUILD_QCH=ON
	cmake --build build
}

check() {
	# tst_sounds.qml is broken
	xvfb-run -a ctest --test-dir build --output-on-failure -E "tst_sounds.qml"
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
dc4359d61dc24bc970acbacb94924bdfa2dbf699f80cc15dc892b22dc6f89494f6616530152dafa4898f48bf24fa3ef24455efc1dd9c35c903a7c5e91ea9c72a  kirigami-addons-1.5.0.tar.xz
"
